.App {
  display: flex;
  justify-content: center;
  text-align: center;
}

.container {
  display: flex;
  flex-direction: column;
  justify-content: start;
  align-items: center;
  flex-wrap: wrap;
  margin: 76px 80px 16px 80px;
}

form.submit {
  border: none;
  padding: 0;
  display: flex;
  outline: none;
}

input {
  box-sizing: border-box;
  border: none;
  padding: 7px 8px;
  font-size: 16px;
  color: inherit;
  border-radius: 12px;
  margin: 0 8px 16px 0;
  height: 48px;
  width: 420px;
  outline: none;
  max-width: 100%; /* для ограничения ширины инпута */
  cursor: pointer;
}

input.submit {
  cursor: pointer;
  border: none;
  height: 48px;
  padding: 9px 4px 9px 40px;
  background: #eeeeee url("search-icon.svg") no-repeat 13px center;
  flex-shrink: 0; /* для предотвращения сжатия кнопки */
}

input.submit:hover,
input.submit:focus {
  background: #e6e6e6 url("search-icon.svg") no-repeat 13px center;
}

button {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 82px;
  height: 48px;
  border: none;
  cursor: pointer;
  background: #eb0c0c;
  border-radius: 12px;
  color: #ffffff;
  font-size: 16px;
  margin: 0 0 16px 0;
}

button:hover {
  background: #c30000;
}

.image-list {
  display: grid;
  width: 90vw;
  grid-template-columns: repeat(auto-fill, minmax(204px, 1fr));
  grid-gap: 8px;
  /*max-height: calc(100vh - 276px); !* для ограничения высоты сетки *!*/
  height: 100%;
  overflow: hidden;
}

.image-list img {
  width: 100%;
  height: 204px;
}

/*Popup*/
.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  /*z-index: 9999;*/
}

.popup-image {
  max-width: 90%;
  max-height: 90%;
}

.close-icon {
  position: absolute;
  left: 96.11%;
  right: 1.67%;
  top: 2.86%;
  bottom: 93.33%;
  background: transparent url("close-icon.svg") no-repeat 0 center;
  cursor: pointer;
  width: 32px;
  height: 32px;
}

/* Стили для мобильного экрана */
@media (max-width: 600px) {
  .container {
    margin: 16px 16px 32px 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: absolute;
    width: 100%;
  }

  form.submit {
    width: 100%;
  }

  form {
    width: 100%;
  }

  input {
    max-width: 488px;
    margin: 0 8px 16px 0;
  }

  input.submit {
    width: 100%;
    margin: 0 8px 16px 0;
  }

  button {
    max-width: 82px;
    margin: 0 0 16px 0;
  }

  .image-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    width: 100%;
  }

  .image-list img {
    max-width: 180px;
    max-height: 180px;
    grid-gap: 8px;
  }
}
